import unittest 

def suma (a,b):
	return a+b

def resta (a,b):
	if type(a) == str or type(b) == str:
		return "error"
	else:
		return a-b
	
def multiplicacion (a,b):
	return a*b

def division (a,b):
	try : 
	 if type(a) == str or type(b) == str: 
		return "error" 
	 div = a/b 
	except ZeroDivisionError : 
	 	return  "no se puede dividir por cero"
	
 	else:
		return div

class testSuma(unittest.TestCase):
	def test (self):
		self.assertEqual(suma(3,4),7)		
		self.assertEqual(suma(-150,147),-3)
		self.assertEqual(suma("como te ","llamas"),"como te llamas")

class testResta(unittest.TestCase):
	def test (self):
		self.assertEqual(resta(10,10),0)
		self.assertEqual(resta(10,-5),15)
		self.assertEqual(resta("como te ","llamas"),"error")
		self.assertEqual(resta(10,"llamas"),"error")
		
class testMultiplicacion(unittest.TestCase):
	def test (self):
		self.assertEqual(multiplicacion(-7,2),-14)
		self.assertEqual(multiplicacion(15,2),30)
		self.assertEqual(multiplicacion("casa",2),"casacasa")
		
class testDivision(unittest.TestCase):
	def test (self):
		self.assertEqual(division(20,10),2) 
		self.assertEqual(division(20,0),"no se puede dividir por cero")
		self.assertEqual(division(20,"tupac"),"error")

if __name__ == "__main__":
	unittest.main()  


